package main

import (
	"flag"
	"fmt"
	"os"
)

func main() {

	var flagSet = flag.NewFlagSet("nsqd", flag.ExitOnError)

	flagSet.String("version", "12345", "[deprecated] has no effect, use --log-level")

	flagSet.Parse(os.Args[1:])

	flagSet.Usage()

	fmt.Println(flagSet.Lookup("version").Value)
}



func main1() {

	var h bool
	var s string
	flag.BoolVar(&h, "h", false, "this help")
	flag.StringVar(&s, "s", "", "send signal to a master process: stop, quit, reopen, reload")

	//flag.Usage = usage
	flag.Parse()

	if h {
		flag.Usage()
	}

	fmt.Println(h, s)

}

func usage() {
	fmt.Fprintf(os.Stderr, `nginx version: nginx/1.10.0
Usage: nginx [-hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
`)
	flag.PrintDefaults()
}